package com.paic.mhis.hcpms.trust.biz.service.impl;

import java.util.HashMap;
import java.util.Map;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.paic.mhis.common.base.dto.PaginationDTO;
import com.paic.mhis.common.base.intergration.dao.CommonDAO;
import com.paic.mhis.common.util.Constants;
import com.paic.mhis.hcpms.trust.biz.service.InsuredMedicalApproveService;
import com.paic.mhis.hcpms.trust.intergration.dao.InsuredMedicalApproveDAO;

@Component("insuredMedicalApproveService")
public class InsuredMedicalApproveServiceImpl implements InsuredMedicalApproveService{
	private static final Logger logger = Logger.getLogger(InsuredMedicalDetailServiceImpl.class);
	@Autowired
	private CommonDAO commonDAO;
	@Autowired
	private InsuredMedicalApproveDAO insuredMedicalApproveDAO;
	@Override
	public Map<String, Object> getMedicalApproveList(Map<Object, Object> paramMap) {
		Map<String, Object> resultMap = new HashMap<String, Object>();
		try {
			PaginationDTO pdto = new PaginationDTO();
			pdto.setDoCount(true);// 查询总条数
			pdto.setQueryAll(false);// 不查询所有记录
			pdto.setQueryParams(paramMap);
			pdto.setStart(Integer.parseInt(paramMap.get("start").toString()));
			pdto.setEnd(Integer.parseInt(paramMap.get("limit").toString())
					+ Integer.parseInt(paramMap.get("start").toString()));
			resultMap = commonDAO.queryPage("findApproveList", pdto);
			resultMap.put(Constants.STATE_KEY, Constants.SUCCESS_STATE_VALUE);
			resultMap.put(Constants.MSG_KEY, Constants.SELECT_SUCCESS);
		} catch (Exception e) {
			e.printStackTrace();
			logger.error(e);
		}
		return resultMap;
	}
	@Override
	public Map<String, Object> findByCaseNo(Map<String, Object> paramMap) {
		Map<String, Object> resultMap = new HashMap<String, Object>();//findByCaseNo //findAuditDetail
		resultMap = (Map<String, Object>) commonDAO.get("findByCaseNo", paramMap);
		return resultMap;
	}

	

}
